package com.yuyou.activity.comm.service.service.impl;

import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.activity.comm.service.entity.PayApply;
import com.yuyou.activity.comm.service.mapper.PayApplyMapper;
import com.yuyou.activity.comm.service.service.IPayApplyService;
import com.yuyou.activity.util.bean.ResBoolSimpleInfo;
import com.yuyou.activity.util.util.Sequence;

@Service
public class PayApplyServiceImpl implements IPayApplyService {

	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private PayApplyMapper payApplyMapper;

	public ResBoolSimpleInfo<String> deleteByPrimaryKey(Long payApplyId) {
		payApplyMapper.deleteByPrimaryKey(payApplyId);
		return ResBoolSimpleInfo.getSuccessInfo();
	}

	public int insert(PayApply record) {
		record.setPayApplyId(Sequence.getSequence().nextId());
		record.setCreateTime(new Date());	
		return payApplyMapper.insert(record);
	}

	public PayApply selectByPrimaryKey(Long payApplyId) {
		return payApplyMapper.selectByPrimaryKey(payApplyId);
	}

	public ResBoolSimpleInfo<String> updateByPrimaryKeySelective(PayApply record) {
		payApplyMapper.updateByPrimaryKeySelective(record);
		return ResBoolSimpleInfo.getSuccessInfo();
	}

	@Override
	public PayApply selectByOrderId(String orderId) {
		return payApplyMapper.selectByOrderId(orderId);
	}

	@Override
	public ResBoolSimpleInfo<String> add(PayApply record) {
		this.insert(record);
		return ResBoolSimpleInfo.getSuccessInfo();
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}